package thread;

public class CurrentThread {
    public static void main(String[] args) {
        Thread main = Thread.currentThread();
        System.out.println("主线程:"+main);
        doSome();
        //自定义线程
        Thread t = new Thread(){
            public void run(){
                Thread t = Thread.currentThread();
                System.out.println("自定义线程:"+t);
                doSome();
            }
        };
        t.start();

    }

    private static void doSome() {
        Thread t = Thread.currentThread();
        System.out.println("执行doSome方法的线程是:"+t);
    }
}
